package com.hx.decorator.passport.upgrade;

import com.hx.decorator.passport.old.ISigninService;
import com.hx.decorator.passport.old.ResultMsg;

/**
 * @author Huathy
 * @date 2021-09-05 16:37
 * @description 对于每个登录方法可以采用策略模式对每个处理逻辑进行分发
 */
public class SignForThirdServiceImpl implements ISignForThirdService {

    private ISigninService iSigninService;

    public SignForThirdServiceImpl(ISigninService iSigninService) {
        this.iSigninService = iSigninService;
    }


    /**
     * QQ登录
     *
     * @param id
     * @return
     */
    @Override
    public ResultMsg loginForQQ(String id) {
        return null;
    }

    /**
     * 微信登录
     *
     * @param id
     * @return
     */
    @Override
    public ResultMsg loginForWechat(String id) {
        return null;
    }

    /**
     * 记住登录状态后自动登录
     *
     * @param token
     * @return
     */
    @Override
    public ResultMsg loginForToken(String token) {
        return null;
    }

    /**
     * 手机号登录
     *
     * @param telphone
     * @param code
     * @return
     */
    @Override
    public ResultMsg loginForTelphone(String telphone, String code) {
        return null;
    }

    /**
     * 注册后自动登录
     *
     * @param username
     * @param passport
     * @return
     */
    @Override
    public ResultMsg loginForRegist(String username, String passport) {
        return null;
    }

    @Override
    public ResultMsg regist(String username, String password) {
        return iSigninService.regist(username,password);
    }

    /**
     * 登录的方法
     *
     * @param username
     * @param password
     * @return
     */
    @Override
    public ResultMsg login(String username, String password) {
        return iSigninService.login(username,password);
    }
}
